package com.yangye.otherdemo.mythreadpoolexecutor;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;

/**
 * @author yangye
 * @date 2020/08/18
 */
public class Test {

	public static void main(String[] args) {
		YangyeThreadPoolExecutor executor = new YangyeThreadPoolExecutor(3, new DefaultPolicyHandler(),
				new LinkedBlockingQueue<>());


		for (int i = 0; i < 10; i++) {
			executor.execute(new TestTask());
		}

	}

	static class TestTask implements Runnable {
		@Override
		public void run() {
			try {
				Thread.sleep(1000);
				System.out.println(Thread.currentThread().getName() + "----");
			} catch (InterruptedException e) {

			}
		}
	}

}
